package com.yun.space.tools;

  
import com.opensymphony.xwork2.ActionContext;  
import com.opensymphony.xwork2.ActionInvocation;  
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import com.yun.space.entity.User;  
  
/** 
 * @author ThinkPad 
 * 
 */  
public class LoginInterceptor extends MethodFilterInterceptor{  
  
    private static final long serialVersionUID = -4409507846064552966L;  
  
    public String doIntercept(ActionInvocation invoker) throws Exception {  
    	User user = (User)ActionContext.getContext().getSession().get("admin");  
        if(null == user){  
            return "login";  // 这里返回用户登录页面视图  
        }  
        return invoker.invoke();  
    }  
}  